package com.flute.tools.data;

import java.util.Collection;
import java.util.Iterator;
import java.util.List;

public class ListDataIterator<T> implements DataIterator<T> {
	private Iterator<T> it;
	private Collection<T> list;

	public ListDataIterator(List<T> list) {
		this.list = list;
		this.it = list.iterator();
	}
	
	public ListDataIterator(Collection<T> list) {
		this.list = list;
		this.it = list.iterator();
	}

	@Override
	public void close() {

	}

	@Override
	public boolean hasNext() {
		return it.hasNext();
	}

	@Override
	public T next() {
		return it.next();
	}

	@Override
	public void reset() {
		it = list.iterator();
	}

}
